#ifndef __AUDIO_SR_H
#define __AUDIO_SR_H
#include "Com_Debug.h"
#include "esp_afe_sr_iface.h"
#include "esp_afe_sr_models.h"
#include "esp_afe_aec.h"

#include "freertos/FreeRTOS.h"
#include "freertos/task.h"
#include "freertos/ringbuf.h"
#include "bsp_sound.h"

typedef struct
{
    bool is_running;
    bool is_wake;

    vad_state_t last_vad_state;

    esp_afe_sr_iface_t *afe_handle;
    esp_afe_sr_data_t  *afe_data;

    RingbufHandle_t ringBuf;

    void (*wake_cb)(void);
    void (*vad_change_cb)(vad_state_t);

} my_sr_t;

extern my_sr_t my_sr;

void audio_sr_init(void);
void audio_sr_start(RingbufHandle_t ringBuf,
                    void (*wake_cb)(void),
                    void (*vad_change_cb)(vad_state_t));
#endif
